//数据类型验证
import {customeStruct} from '../utils';
const itf = customeStruct.interface;

export const InitData = itf({
    payload: itf({
        brands: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string',
            })
        ],
        enterprise: itf({
            id: 'string',
            code: 'string',
            name: 'string',
        }),
        areas: [
            itf({
                id: 'string',
                areaName: 'string',
            })
        ]
    })
});

export const List = itf({
    payload: itf({
        content: [itf(Object.assign({
            id: 'string',
            code: 'string',
            name: 'string',
            brandCode: 'string',
            brandName: 'string',
            areaName: 'string?|null',
            address: 'string?|null',
            email: 'string?|null',
            status: 'number',
            remark: 'string?|null',
            rowVersion: 'string',
            options: 'array'
        }))],
        totalElements: 'number',
    })
});

export const Detail = itf({
    payload: itf({
        id: 'string',
        code: 'string',
        name: 'string',
        brandName: 'string',
        brandCode: 'string',
        regionId: 'string?|null',
        areaName: 'string?|null',
        address: 'string?|null',
        email: 'string?|null',
        remark: 'string?|null',
        options: 'array',
        rowVersion: 'string'
    })
});

